<?php


declare(strict_types=1);

namespace App\Controller;

use App\Model\OrderType;
use Hyperf\HttpServer\Contract\RequestInterface;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Http\Message\ResponseInterface;
use Trait\ResponseMsg;
use Hyperf\Di\Annotation\Inject;
use Util\Common;

class OrderTypeController extends AbstractController
{
    use ResponseMsg;

    #[Inject]
    protected OrderType $orderType;
    /**
     * 获取不同套餐类型
     * @param RequestInterface $request
     * @return ResponseInterface
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
    public function typeList(RequestInterface $request): ResponseInterface
    {
        $type = $request->input('type');
        $list = $this->orderType->getType((int)$type);
        return $this->success($list);
    }
}
